package org.linlinjava.litemall.admin.web.order_manage;

import org.linlinjava.litemall.admin.service.order_manage.AgedmallLocksService;
import org.linlinjava.litemall.admin.vo.locks.*;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @author wj
 * @date 2021/8/11 10:43
 */
@RestController
@RequestMapping("/lockItem")
public class AgedmallLocksController {


    @Resource
    private AgedmallLocksService agedmallLocksService;


    /**
     * 添加控制器
     * @return
     */
    @PostMapping("/addControl")
    public Object addControl(@RequestBody @Validated AddControlVo addControlVo){
        return agedmallLocksService.addControl(addControlVo);
    }

    /**
     * 获取所有类型
     */
    @GetMapping("/getAllDsc")
    public Object getAllDsc(){
        return agedmallLocksService.getAllDsc();
    }


    /**
     * 获取控制器列表
     * @return
     */
    @PostMapping("/controlList")
    public Object controlList(@RequestBody @Validated  ControlList controlList){
        return agedmallLocksService.controlList(controlList);
    }


    /**
     * 新增rfid设备
     */
    @PostMapping("/addRFID")
    public Object addRFID(@RequestBody @Validated AddRFIDVo addRFIDVo){
        return  agedmallLocksService.addRFID(addRFIDVo);
    }


    /**
     * 获取RFID设备列表
     */
    @PostMapping("/chainList")
    public Object chainList(@RequestBody @Validated ChainListVo chainListVo){
        return  agedmallLocksService.chainList(chainListVo);
    }


    /**
     * 更新控制器上下线维护状态
     */
    @PostMapping("/changeControlState")
    public Object changeControlState(@RequestBody @Validated ChangeControlStateVo changeControlStateVo){
        return  agedmallLocksService.changeControlState(changeControlStateVo);
    }


    /**
     * 更新RFID设备上下线维护状态
     */
    @PostMapping("/changeRFIDState")
    public Object changeRFIDState(@RequestBody @Validated ChangeRFIDStateVo changeRFIDStateVo){
        return  agedmallLocksService.changeRFIDState(changeRFIDStateVo);
    }


    /**
     * 更换设备的RFID
     */
    @PostMapping("/replaceRFID")
    public Object replaceRFID(@RequestBody @Validated ReplaceRfidVo replaceRfidVo){
        return  agedmallLocksService.replaceRFID(replaceRfidVo);
    }

    /**
     * 删除RFID设备
     */
    @PostMapping("/deleteRFID")
    public Object deleteRFID(@RequestBody @Validated DeleteRFIDVo deleteRFIDVo){
        return  agedmallLocksService.deleteRFID(deleteRFIDVo);
    }

    /**
     * 删除控制器
     */
    @PostMapping("/deleteControl")
    public Object deleteControl(@RequestBody @Validated DeleteControlVo deleteControlVo){
        return  agedmallLocksService.deleteControl(deleteControlVo);
    }




//    ---↓↓↓↓↓↓↓↓↓---医柜------↓↓↓↓↓↓↓↓↓↓----


    /**
     * 新增RFID商品
     */
    @PostMapping("/addRFIDCommodity")
    public Object addRFIDCommodity(@RequestBody @Validated AddRFIDCommodityVo addRFIDCommodityVo){
        return  agedmallLocksService.addRFIDCommodity(addRFIDCommodityVo);
    }



    /**
     * 获取RFID商品列表
     */
    @PostMapping("/rfidCommodityList")
    public Object rfidCommodityList(@RequestBody @Validated RFIDCommodityListVo rfidCommodityListVo){
        return  agedmallLocksService.rfidCommodityList(rfidCommodityListVo);
    }


    /**
     * 更换RFID商品的RFID
     */
    @PostMapping("/changeRFIDCommodityRFID")
    public Object changeRFIDCommodityRFID(@RequestBody @Validated ChangeRFIDCommodityRFIDVo changeRFIDCommodityRFIDVo){
        return  agedmallLocksService.changeRFIDCommodityRFID(changeRFIDCommodityRFIDVo);
    }


    /**
     * 更新RFID商品上下架、维护状态
     */
    @PostMapping("/changeRFIDCommodityState")
    public Object changeRFIDCommodityState(@RequestBody @Validated ChangeRFIDCommodityStateVo  changeRFIDCommodityStateVo){
        return  agedmallLocksService.changeRFIDCommodityState(changeRFIDCommodityStateVo);
    }

    /**
     * 删除rfid商品
     */
    @PostMapping("/deleteRFIDCommodity")
    public Object deleteRFIDCommodity(@RequestBody @Validated DeleteRfidCommodityVo deleteRfidCommodityVo){
        return  agedmallLocksService.deleteRFIDCommodity(deleteRfidCommodityVo);
    }

    /**
     * 新增衣柜锁
     */
    @PostMapping("/addMedicalLock")
    public Object addMedicalLock(@RequestBody @Validated AddMedicalLockVo addMedicalLockVo){
        return agedmallLocksService.addMedicalLock(addMedicalLockVo);
    }


    /**
     * 获取衣柜锁列表
     */
    @PostMapping("/medicalLockList")
    public Object medicalLockList(@RequestBody @Validated MedicalLockListVo medicalLockListVo){
        return agedmallLocksService.medicalLockList(medicalLockListVo);
    }


    /**
     * 更新医柜锁上下架、维护状态
     */
    @PostMapping("/changeMedicalLockState")
    public Object changeMedicalLockState(@RequestBody @Validated ChangeMedicalLockStateVo changeMedicalLockStateVo){
        return agedmallLocksService.changeMedicalLockState(changeMedicalLockStateVo);
    }

    /**
     * 删除医柜锁
     */
    @PostMapping("/deleteMedicalLock")
    public Object deleteMedicalLock(@RequestBody @Validated DeleteMedicalLockVo deleteMedicalLockVo){
        return agedmallLocksService.deleteMedicalLock(deleteMedicalLockVo);
    }

    /**
     * 获取医柜锁驱动版本列表
     */
    @PostMapping("/getMedicalDversionList")
    public Object getMedicalDversionList(){
        return agedmallLocksService.getMedicalVersionList(1);
    }

    /**
     * 获取医柜锁硬件版本列表
     */
    @PostMapping("/getMedicalHversionList")
    public Object getMedicalHversionList(){
        return agedmallLocksService.getMedicalVersionList(0);
    }

    /**
     * 获取医柜锁详情列表
     */
    @GetMapping("/medicalLockDetail")
    public Object medicalLockDetail( @Validated MedicalLockDetailVo medicalLockDetailVo){
        return agedmallLocksService.medicalLockDetail(medicalLockDetailVo);
    }



    //    ---↓↓↓↓↓↓↓↓↓---扫码枪------↓↓↓↓↓↓↓↓↓↓----


    /**
     * 新增扫码枪
     */
    @PostMapping("/addBargun")
    public Object addBargun(@RequestBody @Validated AddBargunVo addBargunVo){
        return agedmallLocksService.addBargun(addBargunVo);
    }


    /**
     * 获取扫码枪列表
     */
    @PostMapping("/bargunList")
    public Object bargunList(@RequestBody @Validated BargunListVo bargunListVo){
        return agedmallLocksService.bargunList(bargunListVo);
    }


    /**
     * 更新扫码枪上下架、维护状态
     * @return
     */
    @PostMapping("/changeBargunState")
    public Object changeBargunState(@RequestBody @Validated ChangeBargunStateVo changeBargunStateVo){
        return agedmallLocksService.changeBargunState(changeBargunStateVo);
    }


    /**
     * 删除扫码枪
     * @return
     */
    @PostMapping("/deleteBargun")
    public Object deleteBargun(@RequestBody @Validated DeleteBargunVo deleteBargunVo){
        return agedmallLocksService.deleteBargun(deleteBargunVo);
    }



    //    ---↓↓↓↓↓↓↓↓↓---获取库存相关操作------↓↓↓↓↓↓↓↓↓↓----

//    /**
//     * 锁定软连锁库存
//     * @param lockGoodsVo
//     * @return
//     */
//    @RequestMapping("/lockGoods")
//    public Object lockGoods(@RequestBody LockGoodsVo lockGoodsVo){
//        return  agedmallLocksService.lockGoods(lockGoodsVo);
//    }
//
//
//    /**
//     * 取消锁定软连锁库存
//     * @param unLockGoodsVo
//     * @return
//     */
//    @RequestMapping("/unlockGoods")
//    public Object unlockGoods(@RequestBody UnLockGoodsVo unLockGoodsVo){
//        return  agedmallLocksService.unlockGoods(unLockGoodsVo);
//    }
//
//
//    /**
//     * 锁定医柜库存
//     * @param lockGoodsVo
//     * @return
//     */
//    @RequestMapping("/lockCabinetGoods")
//    public Object lockCabinetGoods(@RequestBody LockGoodsVo lockGoodsVo){
//        return  agedmallLocksService.lockCabinetGoods(lockGoodsVo);
//    }
//
//
//    /**
//     * 取消锁定医柜库存
//     * @param unLockGoodsVo
//     * @return
//     */
//    @RequestMapping("/unlockCabinetGoods")
//    public Object unlockCabinetGoods(@RequestBody UnLockCabinetGoodsVo unLockGoodsVo){
//        return  agedmallLocksService.unlockCabinetGoods(unLockGoodsVo);
//    }

}
